package ren.kane.phoenix.some.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author renrk(1275) on 2018-11-02 9:26 AM
 **/
public class TaskRunnable implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("自定义线程任务在执行" + i);
        }
    }

    public static void main(String[] args) {
        ExecutorService service = Executors.newFixedThreadPool(5);
        TaskRunnable task = new TaskRunnable();
        service.submit(task);
        System.out.println("----------------------");
        service.submit(task);
        service.shutdown();
    }
}
